3.1.65 \(\int \log ^2(a+b x) \, dx\) [65]

Optimal. Leaf size=37 \[ 2 x-\frac {2 (a+b x) \log (a+b x)}{b}+\frac {(a+b x) \log ^2(a+b x)}{b} \]

[Out]

2*x-2*(b*x+a)*ln(b*x+a)/b+(b*x+a)*ln(b*x+a)^2/b

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {2436, 2333, 2332} \begin {gather*} \frac {(a+b x) \log ^2(a+b x)}{b}-\frac {2 (a+b x) \log (a+b x)}{b}+2 x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Log[a + b*x]^2,x]

[Out]

2*x - (2*(a + b*x)*Log[a + b*x])/b + ((a + b*x)*Log[a + b*x]^2)/b

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rubi steps

\begin {align*} \int \log ^2(a+b x) \, dx &=\frac {\text {Subst}\left (\int \log ^2(x) \, dx,x,a+b x\right )}{b}\\ &=\frac {(a+b x) \log ^2(a+b x)}{b}-\frac {2 \text {Subst}(\int \log (x) \, dx,x,a+b x)}{b}\\ &=2 x-\frac {2 (a+b x) \log (a+b x)}{b}+\frac {(a+b x) \log ^2(a+b x)}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 36, normalized size = 0.97 \begin {gather*} \frac {2 b x-2 (a+b x) \log (a+b x)+(a+b x) \log ^2(a+b x)}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Log[a + b*x]^2,x]

[Out]

(2*b*x - 2*(a + b*x)*Log[a + b*x] + (a + b*x)*Log[a + b*x]^2)/b

________________________________________________________________________________________

Maple [A]
time = 0.10, size = 40, normalized size = 1.08

method result size
derivativedivides \(\frac {\ln \left (b x +a \right )^{2} \left (b x +a \right )-2 \left (b x +a \right ) \ln \left (b x +a \right )+2 b x +2 a}{b}\) \(40\)
default \(\frac {\ln \left (b x +a \right )^{2} \left (b x +a \right )-2 \left (b x +a \right ) \ln \left (b x +a \right )+2 b x +2 a}{b}\) \(40\)
risch \(\frac {\left (b x +a \right ) \ln \left (b x +a \right )^{2}}{b}-2 x \ln \left (b x +a \right )+2 x -\frac {2 a \ln \left (b x +a \right )}{b}\) \(43\)
norman \(x \ln \left (b x +a \right )^{2}+\frac {a \ln \left (b x +a \right )^{2}}{b}+2 x -2 x \ln \left (b x +a \right )-\frac {2 a \ln \left (b x +a \right )}{b}\) \(49\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

1/b*(ln(b*x+a)^2*(b*x+a)-2*(b*x+a)*ln(b*x+a)+2*b*x+2*a)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 27, normalized size = 0.73 \begin {gather*} \frac {{\left (b x + a\right )} {\left (\log \left (b x + a\right )^{2} - 2 \, \log \left (b x + a\right ) + 2\right )}}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(b*x+a)^2,x, algorithm="maxima")

[Out]

(b*x + a)*(log(b*x + a)^2 - 2*log(b*x + a) + 2)/b

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 36, normalized size = 0.97 \begin {gather*} \frac {{\left (b x + a\right )} \log \left (b x + a\right )^{2} + 2 \, b x - 2 \, {\left (b x + a\right )} \log \left (b x + a\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(b*x+a)^2,x, algorithm="fricas")

[Out]

((b*x + a)*log(b*x + a)^2 + 2*b*x - 2*(b*x + a)*log(b*x + a))/b

________________________________________________________________________________________

Sympy [A]
time = 0.07, size = 42, normalized size = 1.14 \begin {gather*} 2 b \left (- \frac {a \log {\left (a + b x \right )}}{b^{2}} + \frac {x}{b}\right ) - 2 x \log {\left (a + b x \right )} + \frac {\left (a + b x\right ) \log {\left (a + b x \right )}^{2}}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(b*x+a)**2,x)

[Out]

2*b*(-a*log(a + b*x)/b**2 + x/b) - 2*x*log(a + b*x) + (a + b*x)*log(a + b*x)**2/b

________________________________________________________________________________________

Giac [A]
time = 2.82, size = 44, normalized size = 1.19 \begin {gather*} \frac {{\left (b x + a\right )} \log \left (b x + a\right )^{2}}{b} - \frac {2 \, {\left (b x + a\right )} \log \left (b x + a\right )}{b} + \frac {2 \, {\left (b x + a\right )}}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(b*x+a)^2,x, algorithm="giac")

[Out]

(b*x + a)*log(b*x + a)^2/b - 2*(b*x + a)*log(b*x + a)/b + 2*(b*x + a)/b

________________________________________________________________________________________

Mupad [B]
time = 0.29, size = 48, normalized size = 1.30 \begin {gather*} 2\,x-2\,x\,\ln \left (a+b\,x\right )+x\,{\ln \left (a+b\,x\right )}^2+\frac {a\,{\ln \left (a+b\,x\right )}^2}{b}-\frac {2\,a\,\ln \left (a+b\,x\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(a + b*x)^2,x)

[Out]

2*x - 2*x*log(a + b*x) + x*log(a + b*x)^2 + (a*log(a + b*x)^2)/b - (2*a*log(a + b*x))/b

________________________________________________________________________________________